<?php
	class AdminController extends AppController {
		public function index() {
			$this->layout = 'login';
			
			if($this->request->is('post'))
			{
				if($this->Auth->login())
				{
					//$this->Session->setFlash(__(var_dump($this->request->data)));
					$this->redirect(array('controller'=>'baiviets','action'=>'index'));
				}
				else
				{
					$this->Session->setFlash(__('Invalid username or password, try again'));
				}
			}
		}
		
		public function logout() {
		    return $this->redirect($this->Auth->logout());
		}
	}
?>